﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Data;

namespace SL8.SL.Converters
{
    public class CompareValueConverter : IValueConverter
    {
        public object TrueValue
        {
            get;
            set;
        }

        public object TrueResult
        {
            get;
            set;
        }

        public object FalseResult
        {
            get;
            set;
        }

        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if (Object.ReferenceEquals(value, this.TrueValue) || Object.Equals(value, this.TrueValue))
            {
                return this.TrueResult;
            }

            if (value != null && this.TrueValue != null)
            {
                if (value.ToString() == this.TrueValue.ToString())
                {
                    return this.TrueResult;
                }
            }

            return this.FalseResult;
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
